package com.lei.chinese_herbal_medicine.Controller;

import com.lei.chinese_herbal_medicine.Entity.Flow;
import com.lei.chinese_herbal_medicine.Entity.Result;
import com.lei.chinese_herbal_medicine.Service.FlowService;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

/**
 * (Flow)表控制层
 *
 * @author makejava
 * @since 2024-01-25 15:58:45
 */
@RestController
public class FlowController {
    /**
     * 服务对象
     */
    @Resource
    private FlowService flowService;
    @Resource
    Result result;
    @PostMapping("/updateFlow")
    public Result updateFlow(@RequestBody Flow flow){
        System.out.println(flow);
        boolean is=flowService.updateFlow(flow);
        Map map=new HashMap<>();
        if(is){
            result.setCode(200);
            map.put("message","评论成功");
        }else{
            result.setCode(403);
            map.put("message","评论失败");
        }
        result.setData(map);
        return result;
    }
}

